package com.kitty.game.skill.model;


import com.kitty.game.config.Skill;
import com.kitty.common.utils.SpringUtils;
import lombok.Data;
import org.codehaus.jackson.annotate.JsonIgnore;

@Data
public class RoleSkill {
    private int id;

    private int roleId;

    private int SkillId;

    private short level;

    private short targetCount;

    private short type;

    private boolean daily;//是否是生活技能

    private byte costType;//消耗类型

    private byte skillJieshu;//技能阶数

    private int mana;

    private String name;

    public RoleSkill(Skill skill,int level) {
        this.setName(skill.getSkillName());
        this.setRoleId(0);
        this.setType((short) skill.getSkillType());
        this.setSkillId(skill.getSkillId());
        this.setSkillJieshu(skill.getJeishu());
        this.setLevel((short) (level * 1.6));
        this.setMana(0);
        this.setTargetCount((short) SpringUtils.getSkillService().getSkillTargetNum(this));
    }

    public RoleSkill() {
    }

    /**
     * 辅助技能
     * @return
     */
    @JsonIgnore
    public boolean isAssistSkill() {
        return getType() == 138 || getType() == 139;
    }
}
